﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Diagnostics;

namespace DIProject
{
	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main()
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new ApplicationContext(new FirstForm()));
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
            }
		}

		static private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
		{	MessageBox.Show
			(	ApplicationContext.Instance != null? ApplicationContext.Instance.MainForm: null
			,	e.ExceptionObject.ToString()
			,	DIProject.Properties.Resources.strError
			,	MessageBoxButtons.OK
			,	MessageBoxIcon.Error
			,	MessageBoxDefaultButton.Button1
			);
		}
	}
}